/**
 * 
 */
package com.lehecai.core.api.user;

import com.lehecai.core.IntegerBeanLabelItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * 手动提款类型
 * @author He Wang
 *
 */
public class WithdrawRefundManualType extends IntegerBeanLabelItem {


	private static final long serialVersionUID = -254558782217831789L;

	private static final Logger logger = LoggerFactory.getLogger(WithdrawRefundManualType.class.getName());

	private static List<WithdrawRefundManualType> items = new ArrayList<WithdrawRefundManualType>();
	private static List<WithdrawRefundManualType> queryItems = new ArrayList<WithdrawRefundManualType>();



	protected WithdrawRefundManualType(String name, int value, boolean queryOnly) {
		super(WithdrawRefundManualType.class.getName(), name, value);
		queryItems.add(this);
		if (!queryOnly) {
			items.add(this);
		}
	}

	protected WithdrawRefundManualType(String name, int value) {
		this(name, value, false);
	}
	
	public static WithdrawRefundManualType getItem(int value){
		try {
			return (WithdrawRefundManualType) WithdrawRefundManualType.getResult(WithdrawRefundManualType.class.getName(), value);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}
	
	public static List<WithdrawRefundManualType> getItems() {
		return items;
	}
	
	public static List<WithdrawRefundManualType> getItemsForQuery() {
		return queryItems;
	}
	
	public static final WithdrawRefundManualType ALL = new WithdrawRefundManualType("全部", -1, true);
	public static final WithdrawRefundManualType REFUND = new WithdrawRefundManualType("退款", 1);
	public static final WithdrawRefundManualType WITHDRAW = new WithdrawRefundManualType("提款", 2);
	public static final WithdrawRefundManualType REFUND_SPECIAL = new WithdrawRefundManualType("特殊退款", 3);
}
